package rwlivbk.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;
import rwlivbk.service.ChatService;

@RestController
public class LiveController {

    @Autowired
    private ChatService chatService;

    @PostMapping("/live/sendMessageToMQ")
    public String sendMessageToMQ(@RequestBody String message) {
        boolean result = chatService.sendMsg(message);
        return result ? "Message sent successfully" : "Failed to send message";
    }
}
